import * as React from 'react';
import { useSearchParams, useNavigate } from 'react-router-dom'; //路由
import { Button } from 'antd';
import '../../css/admin/adminParticulars.scss'


const AdminParticulars: React.FC = () => {
    const [paramsInfo] = useSearchParams()
    const item: any = paramsInfo.get('item')
    const data = JSON.parse(item)
    // console.log(data);
    const navigate = useNavigate() //路由
    const ReturnList: any = () => {
        navigate('/index/adminList')
    }

    return (<>
        <div className='adminParticulars'>
            <h1 className='xq'>详情</h1>
            <div className='adminParticularsData'>
                <div>管理员ID：{data.admin_id}</div>
                <div>真实姓名：{data.real_name}</div>
                <div>管理员名称：{data.admin_name}</div>
                <div>手机号：{data.mobile}</div>
                <div>所属部门：{data.department}</div>
                <div>邮箱：{data.email}</div>
                <div>角色：{data.role === 1 ? "经管负责人" : data.role === 2 ? "部门负责人" : data.role === ''}</div>
                <div>是否启用：{data.is_use === 1 ? "已启用" : data.is_use === 0 ? "未启用" : data.is_use === ''}</div>
                <div>备注：{data.remarks}</div>
            </div>
            <Button className='return' onClick={ReturnList}>返回列表</Button>
        </div>
    </>);
}

export default AdminParticulars;